/*
 * Copyright (c) 2009 Roman Savelyev
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#ifndef __CONUITERMLOGGER_H__
#define __CONUITERMLOGGER_H__

#if defined(_DEBUG)
#define LOGACTIVE

#include <functionlogger.h>

#define FL(__functionname)                                      CREATEFUNCTIONLOGGER(TTracePrinter, __functionname)
#define FLTRACE(__str)                                          FUNCTIONLOGGER_PRINT(EAddFunctionName, __str)
#define FLTRACE2(__str, __arg1)                                 FUNCTIONLOGGER_PRINT(EAddFunctionName, __str, __arg1)
#define FLTRACE3(__str, __arg1, __arg2)                         FUNCTIONLOGGER_PRINT(EAddFunctionName, __str, __arg1, __arg2)
#define FLTRACE4(__str, __arg1, __arg2, __arg3)                 FUNCTIONLOGGER_PRINT(EAddFunctionName, __str, __arg1, __arg2, __arg3)
#define FLTRACE5(__str, __arg1, __arg2, __arg3, __arg4)         FUNCTIONLOGGER_PRINT(EAddFunctionName, __str, __arg1, __arg2, __arg3, __arg4)
#define FLTRACE6(__str, __arg1, __arg2, __arg3, __arg4, __arg5) FUNCTIONLOGGER_PRINT(EAddFunctionName, __str, __arg1, __arg2, __arg3, __arg4, __arg5)
#define FLTRACEVALUE(__variable)                                FUNCTIONLOGGER_PRINTVALUE(EAddFunctionName, __variable)

class TTracePrinter : public MTracePrinter
    {
public:
    void Print(const TDesC& aDes);
    };

#else
#define FL(__functionname)
#define FLTRACE(__str)
#define FLTRACE2(__str, __arg1)
#define FLTRACE3(__str, __arg1, __arg2)
#define FLTRACE4(__str, __arg1, __arg2, __arg3)
#define FLTRACE5(__str, __arg1, __arg2, __arg3, __arg4)
#define FLTRACE6(__str, __arg1, __arg2, __arg3, __arg4, __arg5)
#define FLTRACEVALUE(__variable)
#endif /* _DEBUG */


#endif /* __CONUITERMLOGGER_H__ */
